Skip to content

Update toolchain nightly-2026-03-14#545

Open
LegNeato wants to merge 36 commits intomainfrom
pr-542-latest-nightly-refresh
Open

Update toolchain nightly-2026-03-14#545
LegNeato wants to merge 36 commits intomainfrom
pr-542-latest-nightly-refresh

Conversation

@LegNeato
Copy link
Collaborator

@LegNeato LegNeato commented Mar 7, 2026

Requires #542

_args: &[OperandRef<'tcx, Self::Value>],
_is_cleanup: bool,
) -> Self::Value {
bug!("LLVM intrinsic call not supported in SPIR-V backend: {instance:?}")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we want to use this rather than our own home-grown replacements, but didn't want to do it in this PR.

@LegNeato LegNeato force-pushed the pr-542-latest-nightly-refresh branch from 14cdf92 to 6434ab8 Compare March 7, 2026 00:22
@nazar-pc
Copy link
Contributor

nazar-pc commented Mar 7, 2026

cargo-gpu will need to be updated again to match this, custom target specs since recently require an unstable CLI option:

error: `.json` target specs require -Zjson-target-spec

@nazar-pc
Copy link
Contributor

nazar-pc commented Mar 8, 2026

Tried to update with a patched cargo-gpu locally and it worked, but generated these warnings that were not present before:

Details
warning: failed to find and remove `format_args!` construction for this `panic!`
    --> /home/nazar-pc/.rustup/toolchains/nightly-2026-03-06-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:2086:9
     |
2086 | /         ub_checks::assert_unsafe_precondition!(
2087 | |             check_language_ub,
2088 | |             "ptr::read_volatile requires that the pointer argument is aligned",
...    |
2092 | |             ) => ub_checks::maybe_is_aligned(addr, align)
2093 | |         );
     | |_________^
     |
     = note: compilation may later fail due to leftover `format_args!` internals
     = note: [RUST-GPU BUG] bailed from panic entry-point call args

warning: failed to find and remove `format_args!` construction for this `panic!`
   --> /home/nazar-pc/.rustup/toolchains/nightly-2026-03-06-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:531:5
    |
531 | /     ub_checks::assert_unsafe_precondition!(
532 | |         check_language_ub,
533 | |         "ptr::copy_nonoverlapping requires that both pointer arguments are aligned and non-null \
534 | |         and the specified memory ranges do not overlap",
...   |
547 | |     );
    | |_____^
    |
    = note: compilation may later fail due to leftover `format_args!` internals
    = note: [RUST-GPU BUG] bailed from panic entry-point call args

warning: failed to find and remove `format_args!` construction for this `panic!`
   --> /home/nazar-pc/.rustup/toolchains/nightly-2026-03-06-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/index.rs:240:9
    |
240 | /         assert_unsafe_precondition!(
241 | |             check_language_ub, // okay because of the `assume` below
242 | |             "slice::get_unchecked requires that the index is within the slice",
243 | |             (this: usize = self, len: usize = slice.len()) => this < len
244 | |         );
    | |_________^
    |
    = note: compilation may later fail due to leftover `format_args!` internals
    = note: [RUST-GPU BUG] bailed from fmt::Arguments::new call sequence ([Call(59851, 1387, [3516, 3517])])

warning: failed to find and remove `format_args!` construction for this `panic!`
   --> /home/nazar-pc/.rustup/toolchains/nightly-2026-03-06-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/index.rs:240:9
    |
240 | /         assert_unsafe_precondition!(
241 | |             check_language_ub, // okay because of the `assume` below
242 | |             "slice::get_unchecked requires that the index is within the slice",
243 | |             (this: usize = self, len: usize = slice.len()) => this < len
244 | |         );
    | |_________^
    |
    = note: compilation may later fail due to leftover `format_args!` internals
    = note: [RUST-GPU BUG] bailed from fmt::Arguments::new call sequence ([Call(59882, 1390, [3522, 3523])])

warning: failed to find and remove `format_args!` construction for this `panic!`
   --> /home/nazar-pc/.rustup/toolchains/nightly-2026-03-06-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/index.rs:260:9
    |
260 | /         assert_unsafe_precondition!(
261 | |             check_library_ub,
262 | |             "slice::get_unchecked_mut requires that the index is within the slice",
263 | |             (this: usize = self, len: usize = slice.len()) => this < len
264 | |         );
    | |_________^
    |
    = note: compilation may later fail due to leftover `format_args!` internals
    = note: [RUST-GPU BUG] bailed from fmt::Arguments::new call sequence ([Call(59911, 1381, [3527, 3528])])

warning: failed to find and remove `format_args!` construction for this `panic!`
   --> /home/nazar-pc/.rustup/toolchains/nightly-2026-03-06-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/index.rs:240:9
    |
240 | /         assert_unsafe_precondition!(
241 | |             check_language_ub, // okay because of the `assume` below
242 | |             "slice::get_unchecked requires that the index is within the slice",
243 | |             (this: usize = self, len: usize = slice.len()) => this < len
244 | |         );
    | |_________^
    |
    = note: compilation may later fail due to leftover `format_args!` internals
    = note: [RUST-GPU BUG] bailed from fmt::Arguments::new call sequence ([Call(59936, 1393, [3533, 3534])])

warning: failed to find and remove `format_args!` construction for this `panic!`
   --> /home/nazar-pc/.rustup/toolchains/nightly-2026-03-06-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/index.rs:240:9
    |
240 | /         assert_unsafe_precondition!(
241 | |             check_language_ub, // okay because of the `assume` below
242 | |             "slice::get_unchecked requires that the index is within the slice",
243 | |             (this: usize = self, len: usize = slice.len()) => this < len
244 | |         );
    | |_________^
    |
    = note: compilation may later fail due to leftover `format_args!` internals
    = note: [RUST-GPU BUG] bailed from fmt::Arguments::new call sequence ([Call(59967, 1396, [3539, 3540])])

warning: failed to find and remove `format_args!` construction for this `panic!`
   --> /home/nazar-pc/.rustup/toolchains/nightly-2026-03-06-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/index.rs:240:9
    |
240 | /         assert_unsafe_precondition!(
241 | |             check_language_ub, // okay because of the `assume` below
242 | |             "slice::get_unchecked requires that the index is within the slice",
243 | |             (this: usize = self, len: usize = slice.len()) => this < len
244 | |         );
    | |_________^
    |
    = note: compilation may later fail due to leftover `format_args!` internals
    = note: [RUST-GPU BUG] bailed from fmt::Arguments::new call sequence ([Call(59998, 1399, [3545, 3546])])

warning: failed to find and remove `format_args!` construction for this `panic!`
   --> /home/nazar-pc/.rustup/toolchains/nightly-2026-03-06-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/index.rs:260:9
    |
260 | /         assert_unsafe_precondition!(
261 | |             check_library_ub,
262 | |             "slice::get_unchecked_mut requires that the index is within the slice",
263 | |             (this: usize = self, len: usize = slice.len()) => this < len
264 | |         );
    | |_________^
    |
    = note: compilation may later fail due to leftover `format_args!` internals
    = note: [RUST-GPU BUG] bailed from fmt::Arguments::new call sequence ([Call(60027, 1384, [3550, 3551])])

warning: failed to find and remove `format_args!` construction for this `panic!`
   --> /home/nazar-pc/.rustup/toolchains/nightly-2026-03-06-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/index.rs:240:9
    |
240 | /         assert_unsafe_precondition!(
241 | |             check_language_ub, // okay because of the `assume` below
242 | |             "slice::get_unchecked requires that the index is within the slice",
243 | |             (this: usize = self, len: usize = slice.len()) => this < len
244 | |         );
    | |_________^
    |
    = note: compilation may later fail due to leftover `format_args!` internals
    = note: [RUST-GPU BUG] bailed from fmt::Arguments::new call sequence ([Call(60052, 1402, [3556, 3557])])

warning: failed to find and remove `format_args!` construction for this `panic!`
   --> /home/nazar-pc/.rustup/toolchains/nightly-2026-03-06-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/index.rs:326:9
    |
326 | /         assert_unsafe_precondition!(
327 | |             check_library_ub,
328 | |             "slice::get_unchecked_mut requires that the index is within the slice",
329 | |             (end: usize = self.end(), len: usize = slice.len()) => end <= len
330 | |         );
    | |_________^
    |
    = note: compilation may later fail due to leftover `format_args!` internals
    = note: [RUST-GPU BUG] bailed from fmt::Arguments::new call sequence ([Call(60985, 1071, [60970]), Call(60988, 1378, [3948, 3949])])

@nazar-pc nazar-pc mentioned this pull request Mar 8, 2026
@LegNeato
Copy link
Collaborator Author

LegNeato commented Mar 8, 2026

Cool, I'll take a look. There were some changes in this area.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder whether this is still needed? After #148789, we can simply detect Arguments::from_str if the argument is a const str.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

panic and panic_nounwind use Arguments::from_str. But panic_display / unreachable_display still go through format_args and panic_bounds_check also formats dynamic values. So I think we need both.

LegNeato added 23 commits March 10, 2026 17:47
@LegNeato LegNeato force-pushed the pr-542-latest-nightly-refresh branch from 2fe48e0 to db063f6 Compare March 11, 2026 00:50
@LegNeato LegNeato marked this pull request as ready for review March 11, 2026 18:15
@LegNeato
Copy link
Collaborator Author

@nazar-pc I think what you saw should be fixed.

@nazar-pc
Copy link
Contributor

Yes, clippy is happy now, tests are passing too

@LegNeato LegNeato requested a review from fee1-dead March 12, 2026 06:35
Comment on lines +360 to +363
let alloc_size = alloc.inner().size();
if alloc_size.bytes() % elem_size.bytes() != 0 {
return None;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be an error right? Would it make sense to silently do nothing here?

Comment on lines 86 to +108
@@ -86,6 +101,12 @@ pub(crate) fn provide(providers: &mut Providers) {
arg.mode = PassMode::Ignore;
}

// SPIR-V backend lowers arguments by-value and cannot handle
// backend-specific indirection/casts at this layer.
if matches!(arg.mode, PassMode::Cast { .. } | PassMode::Indirect { .. }) {
arg.mode = PassMode::Direct(ArgAttributes::new());
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's an make_direct_deprecated above this here. Seems to be duplication?

#![feature(box_patterns)]
#![feature(file_buffered)]
#![feature(if_let_guard)]
#![cfg_attr(bootstrap, feature(if_let_guard))]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think rustc_codegen_spirv ever needs cfg(bootstrap). Should just remove the features that are stabilized?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Annoyingly these were still in the files that the pqp machinery duplicates, so they were needed to not trip our out of sync warning. I saw they were later removed, so I rolled to a newer nightly to pick tat up as the other changes were minimal.

Update the pinned workspace toolchain to rustc 1.96.0-nightly
(1d8897a4e 2026-03-13) and keep REQUIRED_RUST_TOOLCHAIN in sync.

Mirror the current rustc_codegen_ssa crate-attribute header in lib.rs,
keep rustc_codegen_spirv-specific lint allowances outside that mirrored block,
and drop the now-unneeded bootstrap-only header filtering from build.rs.
Use exact rust_gpu attribute paths with get_attrs_by_path, let
AggregatedSpirvAttributes parse filtered iterators directly, and replace the
manual debug filename arena allocation with DroplessArena::alloc_str.

Also port the rustc-private API drift in this nightly by importing
assert_matches from std, using rustc_span::Spanned directly, and renaming
BackendRepr::ScalableVector to SimdScalableVector.
Keep the existing runtime-array reification path for const pointer bitcasts,
but report a specific zombie reason when the backing allocation size is not a
multiple of the runtime-array element size instead of silently falling through
to the generic const_bitcast error.
This disassembly test only cares about the rotate lowering pattern, not source
line tables. Strip OpLine records entirely so line-number drift across toolchains
does not require reblessing the test.
@LegNeato LegNeato changed the title Update toolchain 2026-03-06 Update toolchain nightly-2026-03-14 Mar 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants